package com.geektime.hello;

import java.util.Arrays;
import java.util.List;
import java.util.stream.IntStream;

public class StreamDemo {

    public static void main(String[] args) {
        List<Integer> list = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
        list.forEach(System.out::print);
        System.out.println("\n====================");
        int[] arr = new int[]{1, 2, 3, 4, 5, 6, 7, 8};
        IntStream.of(arr).filter(i -> i < 5).map(i -> i * i).forEach(System.out::println);
    }
}
